LICENSE:
See /shule/Documentation/LICENSE.txt.

INSPIRATION:

This editor was inspired by Notetab Light for Windows (from the Windows 98/2000/XP era), although it is not affiliated with Notetab Light, nor does it use, any of Notetab Light's code—and it is for Linux (see Help->About). I loved how Notetab Light had so many configuration options, and tools like the ability to sort ascending, sort descending, indent, use tabs, etc. When I switched to Linux, the closest thing I could find was SciTE; I used that for a good while before making Shule in the early 2010s. In retrospect, newer versions of Nano are configurable to do more of what I wanted to do than SciTE (but I didn't know how to use Nano much, and I wasn't aware of Nano's potential before I made Shule).


PURPOSES:

• Text-editing
• Plain-text e-reading
• Writing, in plaintext (not just text-editing, but also fiction, journaling, etc.)
• Programming/coding/scripting/markup
• Making plaintext databases
• Improving text file navigation across your computer
• Python-style regular-expression search and replace functionality (grouping and regular expression functions also work).
• Keyboard shortcuts for essentially everything.
• Color customization for essentially everything.

SETUP:
• You might need to unbind some keyboard shortcuts in your desktop environment for some keys and keyboard shortcuts to work as intended in Shule (e.g. left windows key, right windows key, menu, insert, F11—for instance, in Gnome in Ubuntu 26.04, if you set F11 to do fullscreen for apps generally, you'll have to undo that for F11 to work properly in Shule, because Gnome has its own way of doing fullscreen which does not hide the menu). Note that changing compose keys to be anything other than the windows keys, the menu key, and insert is not trivial in Shule's source code (it's pretty difficult to do without breaking Shule in fact), hence me advising unbinding any system shortcuts for those keys, if you want to use them as intended.
• Use the file called INSTALL in Shule's directory to install Shule to your system, if you want to go that route.

EXTENDING AND MODIFYING SHULE:

Shule's source code is pure Python code (and some bash scripts for installation, as well as the icon file). You can directly edit and extend it without compiling it.

For instance, if you want to write a new method for a compose key shortcut, you can just add it to the Editor class, and then press Ctrl+Menu, type the code you want, and then type `&self.myMethodName()` or whatever. Then when you press menu and type the code, it should execute your function.

If you don't like keyboard shortcuts, you can indeed change them in the source code in `shule.py` (navigation keys are handled in `pretext.py`).


MOUSE USAGE:

The keyboard has priority in Shule, but the following may be of great interest to mouse-users as it makes plaintext work much like hyperlinks do, and it's fun:

Various kinds of clicks integrate with indexes. Right-clicking on a word or a selection attempts to open or create a Ki-style index key (press Alt+k to set a base directory before you attempt this; don't pick your home directory unless you want it to take a super long time to do anything, since it will scan the whole thing every time you use it; use a dedicated directory with a specific purpose). Clicking the mouse wheel (button-2 in Linux) will attempt to open a file with the name of the selection or word in the same directory as the currently open one. Note that periods, hyphens, plus signs, underscores, exclamation marks, and question marks count as characters in the same word, but unformatted apostrophes do not. You can alter this behavior in the regular expression within Editor.select_word(). Control-leftclick does the same thing as pressing the middle mouse button.

The mouse is usable for most of the basic things you might expect (hovering, menu selection/navigation, moving the text insert, selecting text, using the scrollbars, pressing buttons in dialogs and such). However, there is no right-click context menu (however, you can still use the regular menu to accomplish those things, using only the mouse). Scrolling the mouse wheel on the tabs will not switch tabs for you. Tabs do not have a close button to click (but you can close them by clicking on them with the mousewheel). The lack of these features helps to ensure stability of use (since those can cause accidents easily, but I might make them optionally available in future).

If you're using KDE, I wanted to add that there's a system setting that lets you hide the mouse pointer when inactive and/or when typing (this should be especially nice when reading).

SHORTCUTS:

I try to make shortcuts for most things. There are a few kinds of shortcuts in this program:
• Regular shortcuts (e.g. Ctrl+t to open a new tab)
• Menu compose key codes (e.g. press the menu button and then type ‘asc’ to sort ascending)
• Left win compose key codes (e.g. press the left Windows key and then type ‘a'’ to insert á into the document)

Menu compose key codes are often indicated in parentheses in the menu item text, while left win compose key codes are often indicates in brackets similarly.

For more information on compose key schemes and codes, see Help->Compose key reference, or press Menu and then type ckr.

Most shortcuts are mentioned in the menu. Most others are mentioned in this file. See Help->Search reference for more information on search shortcuts.

SORTING/SHUFFLE/REVERSE:

There are a variety of ways to sort and order text. You may sort ascending, descending; you may randomize the text; you may reverse the order of the text. If you attempt to sort (or shuffle, etc.) multiple lines, it will sort them by line (and group more deeply indented material with the top-level indent, or the lack of indent if there is one; if the top line of all items sorted has a greater indent than the top-level indent, then it will change that line so it has the number of spaces as the top-level indent). If you attempt to sort a word, it will sort the letters of a word. If you attempt to sort a single line, it will sort the words in the line (unless there are commas, in which case, it will sort items delimited by commas).

If you desire to make it so indents are not grouped with their parent on a multi-line sort, or if you want commas not to delimit sorted chunks on a single-line sort, you can use the following compose key codes (with the menu compose key) to accomplish either of those tasks (the parenthetical statements are not part of the codes, but you’d realize that if you tried to use them):
• psa (sort ascending)
• psd (sort descending)
• psh (shuffle)
• pre (reverse)

Notes:
• `psa` stands for `plain sort ascending`, and so on.
• Tab characters and non-breaking spaces do not count as indents. Use multiple spaces (e.g. four spaces) to indicate an indent.
• Unique sorts are handled separately (there’s a menu item to toggle them on and off), and may be done (or not done) both with plain sorts and grouped sorts.
    ‣ A unique sort is where only unique sort chunks remain after the sort.


READING:

This program is not only a text editor, but is also designed for reading text. Here are some pertinent features for readers:
• Alt+left and Alt+right (as well as Alt+, and Alt+. for one-handed convenience) will jump up and down paragraphs in a fashion well-suited to reading (as opposed to what Control+Up and Control+Down do in text-editing). With this new way of navigation, it skips redundant new lines and ensures the next paragraph with something on it is at the very top of the screen (neatly). For paragraphs longer than the screen, try page-up and page-down instead. Anyway, this feature is so nice for reading, in my opinion.
• Favorites (for quick access and bookmarking of plain text books on your computer)
• Fullscreen mode
• The ability to toggle the menu on and off (Menu+men).
• Margins
• The ability to toggle your set margins on and off
• Autoscroll (it scrolls by lines per amount of time—not by the scrollbars)
• Find
• Document statistics (both case-sensitive and case-insensitive)
• Color themes
• UTF-8 encoding support (this might seem a given nowadays, but when I added the feature, it certainly was not)
• Dictionary lookup
• Countdown timers (if you like to read for a certain amount of time)
• Stopwatches (ditto)
• Age calculator (if you see a date and want to know how long ago it was)
• The features under File->Index can be helpful for readers if writers used any of those features in their writings. These things are useful for dictionaries, glossaries, links, and such. For instance, if you're reading somewhere where the author made an accompanying glossary, then when you want to look something up, you can right-click or click the mousewheel on it to open it (or highlight it and press Ctrl+k or Ctrl+m, depending on where it is). The same features are helpful if you're making your own notes on a book you're reading: for instance, click the mousewheel on a character's name to create or open a file named after that character, in the same directory (or right-click to do it in a special project folder you've designated).
• Regular expression searches (they're not just for text editing and programming, you know)

WRITING:

This program also has writers in mind. There are many features, which should be useful for them. One that may require some explanation as to why it’s there is `Toggle no deletions`. This makes it so you can’t edit the stuff you’ve written. A lot of writers like to avoid over-editing. It can help you to be more careful with what you’re writing in the first place and/or to not get too hung up on mistakes. There are random name generators if you want help coming up with names on the spot. You can password-protect your files. You can insert a time stamp, which I like to do for journal-writing. You can make indexes as described in the `READING` section, which is helpful if you want to type up information about a character, a word, a name, or something, for future reference (without having to search the story for all those details). A file index would be particular to one book, while a directory index would be pertinent to all the books in the directory.


EMAILING:

See Help->Email reference. This is old functionality. It may or may not work anymore.


PROGRAMMING:

Obviously, text editors can be helpful for programmers. This one has a number of features designed to accomodate them (not syntax highlighting, however): For instance, if you press F5, it will run your program. This editor was written in Python; so, it has a bias toward programming in Python. You can run Python scripts without saving them (but if you want proper auto-indent of functions and such, you’ll at least want to rename it to something that ends with .py, even if you don’t save it). The file extension is used to determine how to launch or compile the program.


FAVORITES:

You can save or load favorites. Each favorite represents one or more filepaths, each filepath with a saved location in that document. When you create a favorite you must give it a name. When you load a favorite, you must provide the name in order to load it. While loading one favorite may load any number of files (and your location in those files), you may also have multiple favorites with the same filepath (and optionally different locations in that file).

Example:

So, let’s say you open a book for the first time. It’s Moby Dick, and it’s saved at /home/cynthia/ebooks/moby_dick.txt. If you press Ctrl+d, you will be prompted to type a name for a favorite. You type moby. Then you close the program, go eat lunch and come back. If you don’t remember where moby_dick.txt is (e.g. /home/cynthia/ebooks/moby_dick.txt) it doesn’t matter. Press Ctrl+shift+d to load a favorite. You’ll notice that moby is already in the input box (since it was the last favorite you saved). Press enter. The program will open moby_dick.txt, right at the beginning where you were. Now, let’s say you read several chapters, and want to save your place. To do that, do the same thing you did to make the favorite in the first place: Ctrl+d (it will say moby in the box this time), and press enter. That will update your location.

So, now let’s say you want to save the part where you meet Captain Ahab for the first time, but you don’t want to lose your place. You can do that, but you don’t need mess with the moby favorite. Just make another favorite. Call it ahab or something. When you load moby it’ll take you back to the place where you were reading. If you load ahab, it’ll take you to where you meet Captain Ahab for the first time.

Now, let’s say you write some notes on Moby Dick (and they’re in /home/cynthia/Documents/moby_notes.txt), and you want to load those, too (in another tab), every time you open the moby favorite. While you have moby_notes.txt open, type Ctrl+d and type moby. This will add moby_notes.txt to the moby favorite (and save your location in that document). So, every time you open the mobi favorite it will open both moby_dick.txt and moby_notes.txt. You can also remove a file from a favorite, if desired.

RENAMING AND DELETING FILES:

Because of the way favorites and certain other features are set up, it is recommended that if you rename files that use these features that you rename or delete them in the editor itself. This will allow them to be renamed in your favorites and such, too. Press F2 while the file is open in the current tab to rename it. Or, type Menu and then type ‘del’ to delete it.

FILE->INDEX MENU:

See `file->Index->Index Reference …`.


TEXT STYLES:

You might be surprised to find the option to use text styles in Shule (bold, italic, underline), since this is a text editor. The reason both things can co-exist is because the styles aren't saved. This is sometimes a handy feature if you need to visually distinguish certain text on your screen from the rest of it (only temporarily), for instance, if you're reading a plaintext e-book and the paragraph is super long, you can style parts of the paragraph to make it easier to look back and remember stuff while you're still putting it all together.


WIKIWEB:

Shule provides an interface to doing text-only data entry with Wikiweb. Wikiweb is an entirely separate project of mine. See the reference for it in <…/shule/wikiweb/documentation.txt>. It uses a system involving nodes, contexts, and relations. A node is functionally comparable with a wiki article. Nodes may be related to each other through contexts. Wikiweb has a text-only data entry system, which allows for the quick creation of complex, related data. Consider it experimental at present.

Wikiweb shortcuts:
• Menu+wde (Process the data entry, which is the selected text, or the whole file if no text is selected.)
• Menu+whe (Export the current Wikiweb project to HTML.)

WEB SERVER:

This feature is currently broken on 3 September 2026. Don't bother using it, yet.


GLOB:

You can use Python’s glob module to insert a list of filepaths and/or directory paths (recursively or not) into the text editor. This is useful if you want to create an MP3 playlist, for instance. Use `Menu glp` to be prompted for a filepath (and then for wildcards in the next input box). So, to create an M3U playlist, try this:

Type Menu glp. Then enter '/home/myhomedirectory/Music' for the path. Then enter '**/*.mp3' to get a list of all paths that end in .mp3. Save it as an M3U file and open it with a music player.


Program weaknesses:

• This program doesn’t handle really long lines of text very well if wordwrap is off (but it handles them really well if wordwrap is on, and it handles really long documents very well).
• The open/save dialogs have something to be desired. I haven’t worked out how to make directories look different from files, yet. Sorry about that. I made my own load/save dialog, because I wanted things that the default Tkinter ones didn’t offer. I still think it’s an improvement. However, this isn't the only way to open/save files, and other ways may be more productive (in particular, try Ctrl+Shift+i, Ctrl+m, Ctrl+Shift+o, Alt+k, and Ctrl+k).
• Some of the features I’ve implemented aren’t how I want them to be: e.g. clipboard history. It’s too complicated for me to want to use it all the time. I need to simplify it, somehow, or remove it and just add one or two additional clipboards that you can use instead.
• It doesn’t open as quickly as say, Leafpad. (If you want a simple, fast text editor, use Leafpad! [If it still exists.])
• Tab characters aren’t as supported as tabs comprised of spaces (and it is recommended that you do not use tab characters, since they may, or may not, break some functionality). The tab key produces tabs comprised of spaces already.
• It could use more documentation (including in this file).
• Full screen won't hide the tab bar (Tkinter doesn't make doing that easy, although it is possible).
• If you type the wrong Menu compose key sequence, you could potentially end up doing just about anything; you really have to be careful with that (although I personally haven't had issues there, so hopefully you won't either). Fortunately, you can edit it and use your own schemes if you don't like the defaults. Most mistakes you can undo with Ctrl+z, but not all.


The rest of this file is designed to explain and document various program features (some of which are not documented elsewhere, except perhaps in the source code). I will use ^ on its own line to indicate the beginning of a new feature and $ on its own line to indicate the end of that section.

^
Open URI (Ctrl+Shift+o)(See File->Open):

Open URI attempts to open the following sorts of things:
• An open-file dialog to a single directory.
• One or more existing files.
• One or more web addresss.

If you use Ctrl+Shift+o while selecting text, it will try to parse out all the paths and web addresses from the text and then decide what to do with them. If a valid directory path is included, it will attempt to open that (unless there are multiple of them, in which case it will consider the selection invalid); it will ignore all other URIs here. It there are no valid directory paths, it will seek out existing filepaths and potentially valid web addresses; if both types of URIs are found, it will not open any of them, but if only one type is included it will attempt to open them all. The underlying code it uses is different depending on whether or not a protocol is given (so you might the with/without if the other fails). If you want it to percent encode whitespace, you will have to enter the URL in the input box instead of using a text selection.

To do: Make it so it percent-encodes even when a protocol is given.
$




The following features are not found via the menubar (they are alphabetized by their compose key codes; this is not comprehensive; for a complete listing of all default menu compose shortcuts, see `self.MENU_COMPOSE` in `persist.py`, but the methods they refer to are methods of the Editor class in `shule.py`):

^
(Menu+dfo)
$

^
Downloader, with queuing ability (Menu+dow):

This allows you to select a list of URLs in the editor, /then/ you press `Menu+dow`; then, it downloads those URLs in your selection into your `~/Downloads` folder (it won't prompt you where to save it; so, make sure the folder is ready). It uses axel for the downloading program by default (with 5 connections), but you can switch it in shule.py->Editor.dl()->add_urls() for wget or curl. You can also change the default download directory and number of download connections (for Axel) at the same location.

It allows you to add downloads to the download queue before the currently downloading ones are finished, without having them download at the same time. So, that way, you can get the full download speed, doing one item at a time, without having to wait for the list to finish before you can add more.

WARNING: If you uncomment the lines in shule.py in order to make the terminal halt upon completion instead of exiting, you need to be sure that you exit the terminal after it completes before initiating a new download with Shule's Menu+dow feature. Otherwise, it /might/ cause issues, which issues can be resolved by deleting `~/.dl_settings` and trying again without making the same mistake. The issues aren't as bad as they used to be, though. Nowadays, the issue is that it just might not download a given queue, or it might download some things more than once, and then it will work properly again, provided you don't do the same thing again (previously, it would continue to queue things forever and never download anything again, but that, at least, should be fixed).
$

^
Glob path (Menu+glp)

This takes a directory path and returns a list of filepaths and directory paths within it. It will give you the option to enter glob-style wildcards. It does not use your selection text (you have to use the input box).
$

^
Make selected text an HTML link (Menu+hl):
$

^
Invert color theme (Menu+inv):

This inverts the colors of Shule's widgets.

On Ubuntu 26.04, if you use KDE, there is a system setting that also let you invert colors with keyboard shortcuts. If something steals the shortcuts, and you don't know how to get it back, try making a new one that uses the same keys, reassign it, uncheck it, and then delete the new one you made. Then add it to your invert colors thing again. Gnome can accomplish similar inversion via the `Invert Screen Colors` (version 4), by ilijaculap. In XFCE, you might have to use `xcalib --invert --alter`, but it may not work perfectly with every font with every color scheme.
$

^
Toggle menu bar (Menu+men).

This hides and shows the menu bar, whether or not you're in fullscreen mode. Note that entering fullscreen mode and exiting it will bring the menu bar back. There's currently no mode where it's just always gone.
$

^
Paste with no URL queries (Menu+pas):

This is for pasting a URL copied to the clipboard. It strips URL queries.
$

^
Print decimal color (Menu+pdc):

This takes a hexadecimal color code and prints the decimal equivalent of each of the three colors. It will also convert a selected color, if one is selected.
$

^
Reverse text without grouping (Menu+pre):

This reverses text, but in multi-line scenarios, it does not attempt to treat indented lines after a line as part of the same entity like Menu+rev does [see Menu->Tools->Sort/Shuffle/List->Reverse order (rev)]. It also doesn't take commas and such into consideration when sorting a line of words delimited by spaces (so if you need it to do that, use Menu+rev instead). It just delimits by spaces.
$

^
Sort ascending without grouping (Menu+psa).

This is like Menu+pre, but it sorts ascending instead of reversing.
$

^
Sort descending without grouping (Menu+psd).

This is like Menu+pre, but it sorts descending instead of reversing.
$

^
Shuffle text without grouping (Menu+psh):

This is like Menu+pre, but it shuffles instead of reversing.
$

^
Remove URL queries (Menu+rqu):

This removes URL queries from a URL. Basically, it removes the question mark and everything after it. Also see `Menu+pas` above for the same functionality in pasting a URL.
$